/*
 ******************************************************************************
 *  Java Signal Framework for routing java objects. 
 *  Copyright (C) 2008  Manuel Stahl (thymythos@web.de)
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ****************************************************************************** 
 */
package org.tru42.signal.lang;

/**
 * Mark an object as possibly connectable with another object.
 * @author Manuel Stahl (thymythos@web.de)
 *
 */
public interface IConnectable {

	/**
	 * Test if this object is compatible to another.
	 * TODO: make this method symmetric
	 * @param obj
	 * @return true if compatible
	 */
	public boolean compatible(Object obj);
	
	/**
	 * Connect this object to another object. The implementation of this method
	 * has to take care that both objects get informed of the connection.
	 * 
	 * TODO: only allow IConnectable as parameter?
	 * @param obj object to connect to
	 */
	public void connect(Object obj) throws ConnectException;
	
	/**
	 * Disconnect this object from another object. The implementation of this method
	 * has to take care that both objects get informed of the disconnection.
	 */
	public void disconnect();
	
	public boolean isConnected();
}
